package fr.norsys.mapper.console.test;

import java.util.Comparator;

import fr.norsys.mapper.console.model.Variable;

public class VariableNameComparator implements Comparator {

	public int compare(Object o1, Object o2) {
		if(o1 != null && o2 != null && o1 instanceof Variable && o2 instanceof Variable) {
			Variable r1 = (Variable) o1;
			Variable r2 = (Variable) o2;
			if(r1.getName()!=null && r2.getName()!=null)
				return r1.getName().compareTo(r2.getName());
		}
		return 0; 
	}
}
